package top.kaoshanji.p3ch20c;

/**
 * 代码清单-p3ch20c-238页c：场景类
 * @author kaoshanji
 * ^_^
 * create time 2025/3/24 18:47
 */
public class Client {

    public static void main(String[] args) {

        // 声明出容器
        Aggregate agg = new ConcreteAggregate();

        // 产生对象数据放进去
        agg.add("abc");
        agg.add("aaa");
        agg.add("1234");

        // 遍历一下
        Iterator iterator = agg.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }

    }


}
